function logJson(objs) {
    return objs.map(obj => JSON.stringify(obj, null, 2) + '\n');
}

module.exports = {
    log: this.logi,
    logi(msg = 'INFO:', ...objs) {
        console.log(msg + '\n', ...logJson(objs));
    },
    loge(err, ...objs) {
        // console.log("Error:\n", err, ...logJson(objs));
        // @TODO write to file
    }
};